package com.lqk.service.impl;

import com.lqk.dao.mapper.CitizenInfoMapper;
import com.lqk.dao.po.CitizenInfoPO;
import com.lqk.entity.CitizenInfoEntity;
import com.lqk.service.CitizenInfoService;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author liqiankun@nnuo.com
 * @date 2023/3/10 17:11
 * @description 公民信息-业务实现层
 **/
@Service
public class CitizenInfoServiceImpl implements CitizenInfoService {
        public final static Logger logger = LoggerFactory.getLogger(CitizenInfoServiceImpl.class);
        @Autowired
        private CitizenInfoMapper citizenInfoMapper;

        @Override
        public CitizenInfoEntity queryCitizenInfoByIdCard(String idCard) {
                CitizenInfoPO citizenInfo = citizenInfoMapper.selectByIdCard(idCard);
                CitizenInfoEntity citizenInfoEntity = new CitizenInfoEntity();
                BeanUtils.copyProperties(citizenInfo,citizenInfoEntity);
                logger.info("公民信息：：{}",citizenInfo);
                return citizenInfoEntity;
        }
}
